<template>
	<view v-if="pageShow" class="mainpadding2">
		<view class="mainpadding_top shadow ffffff radius flexleft dingwei">
			<view class="checkfocus xiaobai" style="background-color: #31a3d6;" v-show="dataAll.shopstaff_id">員工</view>
			<image src="/static/logo.png" mode="" class="radius" style="min-width: 100rpx;width: 100rpx;height: 100rpx;" v-if="dataAll.shopstaff_id"></image>
			<image :src="dataAll.shopinfo.logoimage_text" class="radius" mode="" style="min-width: 100rpx;width: 100rpx;height: 100rpx;" v-if="!dataAll.shopstaff_id"></image>
			<view class="margin_left2"  v-if="dataAll.shopstaff_id">
				<view class="xiaohei titletext ">{{dataAll.staffinfo.name}}
				</view>
			</view>
			<view class="margin_left2" v-if="!dataAll.shopstaff_id">
				<view class="xiaohei titletext ">{{dataAll.shopinfo.name}}
				</view>
			</view>
		</view>
		<!-- <view class="mainpadding_top radius shadow" style="background-color: #fbf6f1;">
			<view class="flexleft pdl" style="padding-bottom: 10rpx;">
				<view class="margin_right2">
					<image :src="dataAll.image_text" mode="" class="radius"
						style="width: 120rpx;height: 120rpx;min-width: 120rpx;"></image>
				</view>
				<view class="line margin_right2"></view>
				<view>
					<view class="hei_text titletext bold" style="word-break: break-all;">{{dataAll.name}}</view>
				</view>
			</view>
			<view class="flexleft margin_top1" v-if="dataAll.get_starttime_text">
				<view class="hui_text bold" style="font-size: 26rpx;">領取時間</view>
				<view class="hong_text bold " style="font-size: 26rpx;">
					{{dataAll.get_starttime_text}}~{{dataAll.get_endtime_text}}</view>
			</view>
			<view class="flexleft margin_top1" v-if="!dataAll.get_starttime_text">
				<view class="hong_text bold " style="font-size: 26rpx;">等待領取時間~</view>
			</view>
		</view> -->
		<view class="mainpadding_top ffffff radius shadow">
			<view class="titletext hei_text bold">已點商品</view>
			<view class="" v-for="(item,index) in dataAll.spu_data_text" :key="item.id">
				<view class="flexleft margin_top pdl" v-if="value.num!=0"
					v-for="(value,i) in item.spu_item" :key="value.id">
					<view class="listleftimg2 radius margin_right">
						<image class="listleftimg2 radius" :src="value.image_text" mode=""></image>
					</view>
					<view style="width: 100%;">
						<view class="hei_text titletext bold yihang">{{value.name}}</view>
						<view class="flexbetween margin_top" style="width: 100%;">
							<view class="huang_text main_sizemargin_top">
								<text class="main_size color_red margin_right1" v-if="dataAll.is_staff==1">${{value.yg_money}}</text>
								<text class="main_size color_red margin_right1" v-if="dataAll.is_staff!=1">${{value.money}}</text>
								<text class="hei_text">X{{value.num}}</text>
							</view>
							<view class="main_size bold color_red">${{value.total_price}}</view>
						</view>
					</view>
				</view>
			</view>
			<view style="border-bottom: 1rpx dashed #333;padding-bottom: 20rpx;"></view>
			<view class="flexbetween margin_top2">
				<view class="hei_text main_size">訂單應付</view>
				<view class="hong_text main_size ">${{dataAll.pay_price}}</view>
			</view>
			<view class="flexbetween margin_top2">
				<view class="huang_text main_size" v-show="dataAll.payinfo.paytype==1">
					點數支付
				</view>
				<view class="huang_text main_size" v-show="dataAll.payinfo.paytype==2">多元支付
				</view>
				<view class="huang_text main_size" v-show="dataAll.payinfo.paytype==3">現金支付
				</view>
				<view class="huang_text main_size" v-show="dataAll.payinfo.paytype==4">信用卡
				</view>
				<view class="huang_text main_size" v-show="dataAll.payinfo.paytype==5">Line Pay線上支付
				</view>
				<view class="huang_text main_size" v-show="dataAll.payinfo.paytype==6">街口線上支付
				</view>
				<view class="huang_text main_size" v-show="dataAll.payinfo.paytype==7">街口線下支付
				</view>
				<view class="huang_text main_size" v-show="dataAll.payinfo.paytype==8">Line Pay線下支付
				</view>
				<view class="huang_text main_size" v-show="dataAll.payinfo.paytype==9">Line Pay二維碼支付
				</view>
				<view class="huang_text main_size" v-show="dataAll.payinfo.paytype==10">街口二維碼支付
				</view>
				<view class="huang_text main_size" v-show="dataAll.payinfo.paytype==11">全支付線下支付
				</view>
				<view class="hong_text main_size ">-${{dataAll.pay_price}}</view>
			</view>
			<view class="flexbetween margin_top2">
				<view class="hei_text main_size">未收金額</view>
				<view class="hong_text main_size ">$0</view>
			</view>
		</view>
		<view class="posibottom mainpadding" style="padding-bottom: 0;" v-if="dataAll.status==2 && dataAll.get_starttime_text">
			<view class="submitbtn" @click="submit">確認核銷</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pageShow:false,
				listid:"",
				dataAll:{}
			}
		},
		onLoad(options) {
			this.listid = options.id
			this.getDetail()
		},
		methods: {
			getDetail(){
				this.http.request("/api/Shopwelfarecl/welfareclOrderDetail", 'POST', {
					id:this.listid
				}).then(res=>{
					this.dataAll = res.data
					this.pageShow = true
				})
			},
			submit(){
				this.http.request("/api/Shopwelfarecl/smWelfareclOrderDetail", 'POST', {
					id:this.listid,
					shop_id:uni.getStorageSync('shop_id')
				}).then(res=>{
					this.http.toast(res.msg)
					if(res.code==1){
						setTimeout(()=>{
							uni.navigateBack(1)
						},500)
					}
				})
			},
		}
	}
</script>

<style>

</style>
